Skip to content

Enable default for option and argument arrays #186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 22, 2020

Conversation

john-mueller
Copy link
Contributor

The adds the default parameter to @Option and @Argument initializers when the value type is an array. Default values are overridden when passing explicit values on the command line. Default is still an empty array if default parameter is omitted and no explicit values are passed.

Closes #107

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

Copy link
Member

@natecook1000 natecook1000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome, @john-mueller! Really appreciate the example for the guide. 👏👏

A couple of notes on implementation below — thanks!

@natecook1000
Copy link
Member

@swift-ci Please test

@natecook1000 natecook1000 merged commit f07d2fb into apple:master Jun 22, 2020
@john-mueller john-mueller deleted the default-for-array branch June 23, 2020 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a default value for @Option when the type is an Array
2 participants